#ifndef DESKTOP_LEGEND_PLOT_UTIL_H
#define DESKTOP_LEGEND_PLOT_UTIL_H

class EPlotRenderer;

class MG_DESKTOP_API MgLegendPlotUtil
{
public:

    MgLegendPlotUtil(MgResourceService* svcResource);
    virtual ~MgLegendPlotUtil();

    /*
    void AddTitleElement(MgPrintLayout* layout, STRING& mapName, EPlotRenderer& dr);
    void AddScalebarElement(MgPrintLayout* layout, RS_Bounds& mapBounds, double dMapScale, double dMetersPerMapUnit, EPlotRenderer& dr, RS_LineStroke& lineStroke);
    void AddNorthArrowElement(MgPrintLayout* layout, EPlotRenderer& dr, RS_LineStroke& lineStroke);
    void AddUrlElement(MgPrintLayout* layout, STRING& mapURL, EPlotRenderer& dr);
    void AddDateTimeElement(MgPrintLayout* layout, EPlotRenderer& dr);
    void AddCustomLogoElement(MgPrintLayout* layout, EPlotRenderer& dr);
    void AddCustomTextElement(MgPrintLayout* layout, EPlotRenderer& dr);

    void AddLayoutElements(MgPrintLayout* layout, STRING mapName, STRING mapURL, MgdMap* map, MgLayerCollection* layers, RS_Bounds& mapBounds, double& dMapScale, double& dMetersPerMapUnit, EPlotRenderer& dr);
    void ComputeLegendOffsetAndSize(MgPrintLayout* layout, double mapScale, EPlotRenderer& dr, MgdMap* map, double &legendOffsetX, double& legendOffsetY, double& legendWidth, double& legendHeight);
    */

    //These have been cleaned up to work with a generic renderer, rather than just EPlot.
    //Eventually the scale bar and north arrow ones need to be cleaned up also in order
    //to use them in the AJAX viewer
    void AddLegendElement(double dMapScale, Renderer& dr, MgdMap* map, MgPlotSpecification* plotSpec, double legendOffsetX, double legendOffsetY);
    void ProcessLayersForLegend(MgdMap* map, double mapScale, MgLayerGroup* mggroup, double startX, double& startY, RS_TextDef textDef, Renderer& dr, MgPlotSpecification* plotSpec, double legendOffsetY, double convertUnits);
    void BuildLegendContent(MgdMap* map, double scale, MgPlotSpecification* legendSpec, double legendOffsetX, double legendOffsetY, Renderer& dr, double convertUnits);

    void ExtentFromMapCenter(MgdMap* map, double metersPerUnit, RS_Bounds& b);

private:

    MgResourceService* m_svcResource;
    RS_String m_legendFontName;
};

#endif